package kr.hkit.powerjava.chapter25;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLConnection;

public class URLConnectionReader {
	public static void main(String[] args) throws IOException {
		URL yahoo = new URL("http://www.naver.com");
		URLConnection yc = yahoo.openConnection();
		BufferedReader in = new BufferedReader(new InputStreamReader(yc.getInputStream()));
		
		String inLine;
		
		while( (inLine = in.readLine()) != null){
			System.out.println(inLine);
		}
		in.close();
	}
}
